﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using SERP.StringMappings;
using SERP.DAO;
using SERP.Controllers;
namespace SERP.Modules.Modules{
	public partial class ModulesViewInfo : SERP.Modules.ModuleBase
	{
		private ModulesController controller = new ModulesController();
		public ModulesController Controller{
			get{
				return controller;
			} 
		}
		protected void Page_Load(object sender, EventArgs e){
    		LoadLanguage();	
			if(!this.IsPostBack){		
				BindInfo();	
			}
		}
		//Load All lable text
		private void LoadLanguage(){
			labelModuleName.Text=ModulesStringMapping.ModuleName+":";
			labelDescription.Text=ModulesStringMapping.Description+":";
			labelIconName.Text=ModulesStringMapping.IconName+":";
			labelModuleLink.Text=ModulesStringMapping.ModuleLink+":";
			labelModuleType.Text=ModulesStringMapping.ModuleType+":";
		}
		public ModulesEntity GetObject(){
			controller.LoadObject(Int32.Parse(Request["ModuleId"]));
			return controller.ModulesObject;
		}
		private void BindInfo(){
			ModulesEntity o=GetObject();		
			CopyToSreen(o);
		}
		private void CopyToSreen(ModulesEntity o){
			txtModuleName.Text=o.ModuleName;
			txtDescription.Text=o.Description;
			txtIconName.Text=o.IconName;
			txtModuleLink.Text=o.ModuleLink;
			txtModuleType.Text=Convert.ToString(o.ModuleType);
		}   
}
}
